<template>
  <div :class="active ? 'entry-icon-container active' : 'entry-icon-container'">
    <img :src="img" alt="" :style="{
      width: !isNaN(imgWidth)? imgWidth+'px':imgWidth,
      height: !isNaN(imgHeight)? imgHeight+'px':imgHeight,
    }"/>
    <div
      class="text"
      :style="{
        ...textStyle,
      }"
    >
      {{ text }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    img: {
      type: String,
      required: true,
    },
    text: {
      type: String,
      default: "",
    },
    active: {
      type: Boolean,
      default: false,
    },
    textStyle: {
      default: null,
    },
    imgWidth: {
      default: 'auto',
    },
    imgHeight: {
      default: 'auto',
    }
  },
};
</script>

<style lang="scss" scoped>
.entry-icon-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-bottom: 10px;
  img {
    margin-bottom: 10px;
  }
  .text {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
  }
  &.active {
    border-bottom: 2px solid #285fce;
    .text {
      color: #285fce;
    }
  }
}
</style>
